package ABC.Z314;

import java.util.Scanner;

public class kaishi {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("*****欢使用”吃货联盟”*******");
        String[] name = new String[4];
        String[] caiping = {"红烧带鱼", "鱼香肉丝", "时令水果", "新鲜蔬菜"};
        Double[] money = {38.0, 28.0, 18.0, 15.0};
        double[] time = new double[4];
        boolean[] states = new boolean[4];
        double[] sunmony = new double[4];
        String[] adress = new String[4];
        String[] caipingfenshu = new String[4];
        int b = 0;//用户每次进行选择；
        boolean f = false;
         {
            System.out.println("1我要订餐");
            System.out.println("2查看餐袋");
            System.out.println("3签收订单");
            System.out.println("4删除订单");
            System.out.println("5我要点赞");
            System.out.println("6退出系统");
            System.out.print("请选择：");
            b = input.nextInt();
            switch (b) {
                case 1:
                    System.out.println("我要订餐");
                    for (int i = 0; i < name.length; i++) {
                        if (name[i] == null) {
                            System.out.println("请输入您的姓名：");
                            String name1 = input.next();
                            System.out.println("序号\t菜品名\t价格");
                            for (int j = 0; j < caiping.length; j++) {
                                System.out.print((j + 1) + "\t");
                                System.out.print(caiping[j] + " ");
                                System.out.println(money[j] + " ");

                            }
                            System.out.println("请输入你的菜品序号");
                            int mun = input.nextInt();
                            System.out.println(caiping[mun - 1] + " " + money[mun - 1]);
                            System.out.println("请问你要几份:");
                            int mun2 = input.nextInt();
                            System.out.println(caiping[mun - 1] + mun2 + "份");
                            double money1 = money[mun - 1] * mun2;
                            if (money1 > 50) {
                                money1 = money1;
                            } else {
                                money1 = money1 + 6.0;
                            }
                            System.out.println("您总共花了" + money1);
                            System.out.println("请输入你的地址：");
                            String adress1 = input.next();
                            System.out.println("您的地址为" + adress1);
                            System.out.println("请您输入你的配送时间：");
                            double time1 = input.nextDouble();
                            if (time1 > 20.0 || time1 < 8.0) {
                                System.out.println("请您在次选择配送时间：");
                                time1 = input.nextDouble();
                            }
                            System.out.println("恭喜您点餐成功");
                            name[i] = name1;
                            time[i] = time1;
                            sunmony[i] = money1;
                            caipingfenshu[i] = caiping[mun - 1] + mun2 + "份";
                            states[i] = false;
                            adress[i] = adress1;

                            break;
                        }
                    }
                    break;
                case 2:
                    System.out.println("查看餐袋");
                    System.out.println("序号\t姓名\t时间\t地址\t状态\t总金额");
            }
        }
    }
}